// sensordatathread.h
#ifndef SENSORDATATHREAD_H
#define SENSORDATATHREAD_H

#include <QThread>
#include <QDateTime>
#include <chrono>
#include "sensor_connector/sensor_connector.h"
#include "sensor_connector/method.h"
class SensorDataThread : public QThread
{
    Q_OBJECT
public:
    explicit SensorDataThread(QObject *parent = nullptr);
    ~SensorDataThread();
    void stop();

signals:
    // 发送传感器数据更新信号
    void sensorDataUpdated(double time, double fx, double fy, double fz);

protected:
    void run() override;

private:
    bool m_running;
    QDateTime m_startTime;

    haptron::SensorConnector* m_sensorConnector;

    void initSensorConnector();
    void cleanupSensorConnector();
};

#endif // SENSORDATATHREAD_H

